<%@ Page Language="C#" MasterPageFile="~/Default.master" AutoEventWireup="true" CodeFile="YesNoVote.aspx.cs" Inherits="Templates_YesNoVote" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cphHeader" Runat="Server">
    <acms:FlashContentControlDisplay ID="flashHeader" ControlName="FlashHeader" WMode="Transparent" MaxWidth="800" runat="server" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphBody" Runat="Server">
    <acms:FlashContentControlDisplay ID="flashIntro" ControlName="FlashIntro" WMode="Transparent" MaxWidth="500" runat="server" />
    <acms:ImageContentControlDisplay ID="imageIntro" ControlName="ImageIntro" runat="server" />
    <asp:UpdatePanel ID="pnlGraph" UpdateMode="Conditional" runat="server">
        <ContentTemplate>
            <acms:FlashControl ID="flashGraph" FlashFileUrl="~/flash/barchart.swf" WMode="Transparent" Width="500" Height="150" runat="server" />
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:LoginView ID="loginView" runat="server">
        <AnonymousTemplate>
           <a class="needToLogInVote" href="<%=GetLoginUrl()%>"></a>
        </AnonymousTemplate>
        <LoggedInTemplate>
            <div class="htmlArticle">
                <asp:UpdatePanel ID="pnlVote" UpdateMode="Conditional" runat="server">
                    <ContentTemplate>
                        <h2>Add your Vote...</h2>
                        <asp:Panel ID="pnlPrevVote" runat="server">
                            You have voted "<asp:Label ID="lblPrevVote" runat="server" />". If you would like to change your vote simply click bellow.
                        </asp:Panel>
                        <asp:Button ID="btnYes" Text="Sienna" OnClick="btnYes_Click" runat="server" />
                        <asp:Button ID="btnNo" Text="Kelly" OnClick="btnNo_Click" runat="server" />
                    </ContentTemplate>
                </asp:UpdatePanel>
            </div>
            <div class="htmlArticle">
                <asp:UpdatePanel ID="pnlYourComment" UpdateMode="Conditional" runat="server">
                    <ContentTemplate>
                        <h2>Add your comment...</h2>
                        <asp:Label ID="lblTitle" AssociatedControlID="txtTitle" Text="Title" runat="server" /><br />
                        <asp:TextBox ID="txtTitle" MaxLength="500" Columns="40" runat="server" /><br />
                        <asp:RequiredFieldValidator ID="valTitleReq" ControlToValidate="txtTitle" ValidationGroup="AddComment" Display="Dynamic" ErrorMessage="Title is required.<br />" runat="server" />
                        <asp:Label ID="lblComment" AssociatedControlID="txtComment" Text="Comment" runat="server" /><br />
                        <asp:TextBox ID="txtComment" MaxLength="2000" Rows="10" Columns="40" TextMode="MultiLine" runat="server" /><br />
                        <asp:RequiredFieldValidator ID="valCommentReq" ControlToValidate="txtComment" ValidationGroup="AddComment" Display="Dynamic" ErrorMessage="Comment is required.<br />" runat="server" />
                        <asp:Button ID="btnAddComment" Text="Add Comment" OnClick="btnAddComment_Click" ValidationGroup="AddComment" runat="server" />
                    </ContentTemplate>
                </asp:UpdatePanel>
            </div>
        </LoggedInTemplate>
    </asp:LoginView>
    <asp:UpdatePanel ID="pnlComments" UpdateMode="Conditional" ChildrenAsTriggers="false" runat="server">
        <ContentTemplate>
            <div class="htmlArticle">
                <h3><asp:Label ID="lblTotalComments" runat="server" /> Comments</h3>
            </div>
            <acms:AcmsDataList ID="lstComments" DataKeyFields="Id,ConcurencyId" UseAjax="true" DataSourceID="dsUserComments" OnItemDataBound="lstComments_ItemDataBound" OnItemCommand="lstComments_ItemCommand" OnDataBound="lstComments_DataBound" runat="server">
                <NoDataStyle CssClass="htmlArticle" />
                <NoDataTemplate>
                    There are currently no comments.
                </NoDataTemplate>
                <ItemStyle CssClass="htmlArticle" />
                <ItemTemplate>
                    <div class="commentHolder">
                    <asp:PlaceHolder ID="phNormal" runat="server">
                         <h4><%#Eval("Title") %></h4>
                        <p><%#Eval("Comment").ToString().Replace("\n", "<br/>") %></p>
                        <span style="float:left; margin:4px 0px 4px 0px;"><span class="commentUserName"><%#Eval("UserName")%></span> @ <%#Eval("Created")%></span>
                        <asp:LinkButton ID="lnkReport" CssClass="reportComment" CommandName="Report" Text="Report unsuitable comment" runat="server" />
                   </asp:PlaceHolder>
                    
                    <asp:PlaceHolder ID="phReported" runat="server">
                      <span class="commentReported">This comment has been reported by another user. It has not yet been reviewed by the moderator.</span>
                        <asp:LinkButton ID="lnkShow" CommandName="Show" Text="Show comment..." runat="server" /><br />
                          <span style="margin:4px 0px 4px 0px;"><span class="commentUserName"><%#Eval("UserName")%></span> @ <%#Eval("Created")%></span>
                    </asp:PlaceHolder>
                    
                    <asp:PlaceHolder ID="phSuspended" runat="server">
                        <h4>This comment has been removed.</h4>
                    </asp:PlaceHolder>
                   
                    </div>
                     
                </ItemTemplate>
            </acms:AcmsDataList>
        </ContentTemplate>
    </asp:UpdatePanel>
    <acms:UserPostCommentDataSource ID="dsUserComments" OnSelectData="dsUserComments_SelectData" runat="server" />
</asp:Content>

